<!-- HTML header for doxygen 1.9.6-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="zh">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.9.6"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>COMMONS-NET: commonsNet.ntp.TimeStamp类 参考</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
  $(document).ready(function() { init_search(); });
/* @license-end */
</script>
<link href="style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr id="projectrow">
  <td id="projectalign">
   <div id="projectname">COMMONS-NET
   </div>
  </td>
    <td>        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <span id="MSearchSelect"                onmouseover="return searchBox.OnSearchSelectShow()"                onmouseout="return searchBox.OnSearchSelectHide()">&#160;</span>
          <input type="text" id="MSearchField" value="" placeholder="搜索" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.svg" alt=""/></a>
          </span>
        </div>
</td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- 制作者 Doxygen 1.9.6 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(document).ready(function(){initNavTree('classcommonsNet_1_1ntp_1_1TimeStamp.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">载入中...</div>
<div class="SRStatus" id="Searching">搜索中...</div>
<div class="SRStatus" id="NoMatches">未找到</div>
</div>
</div>
</div>
</div>

<div class="header">
  <div class="summary">
<a href="#pub-methods">Public 成员函数</a> &#124;
<a href="#pub-attribs">Public 属性</a> &#124;
<a href="#pro-methods">Protected 成员函数</a> &#124;
<a href="#pro-attribs">Protected 属性</a> &#124;
<a href="#pri-methods">Private 成员函数</a> &#124;
<a href="#pri-attribs">Private 属性</a> &#124;
<a href="classcommonsNet_1_1ntp_1_1TimeStamp-members.html">所有成员列表</a>  </div>
  <div class="headertitle"><div class="title">commonsNet.ntp.TimeStamp类 参考</div></div>
</div><!--header-->
<div class="contents">

<p>TimeStamp 类表示网络时间协议（NTP）时间戳，按照 RFC-1305 和简单网络时间协议（SNTP，RFC-2030）定义。  
 <a href="classcommonsNet_1_1ntp_1_1TimeStamp.html#details">更多...</a></p>
<div class="dynheader">
类 commonsNet.ntp.TimeStamp 继承关系图:</div>
<div class="dyncontent">
 <div class="center">
  <img src="classcommonsNet_1_1ntp_1_1TimeStamp.png" alt=""/>
 </div></div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pub-methods" name="pub-methods"></a>
Public 成员函数</h2></td></tr>
<tr class="memitem:accd3819963b2bba840856d37eaf4a5b5"><td class="memItemLeft" align="right" valign="top">public&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcommonsNet_1_1ntp_1_1TimeStamp.html#accd3819963b2bba840856d37eaf4a5b5">init</a> (ntpTime: Int64)</td></tr>
<tr class="memdesc:accd3819963b2bba840856d37eaf4a5b5"><td class="mdescLeft">&#160;</td><td class="mdescRight">创建一个 TimeStamp 对象，使用给定64位长整型参数对时间戳进行赋值。  <br /></td></tr>
<tr class="separator:accd3819963b2bba840856d37eaf4a5b5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae948f4d32dd3b8398705094e600c72d4"><td class="memItemLeft" align="right" valign="top">public&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcommonsNet_1_1ntp_1_1TimeStamp.html#ae948f4d32dd3b8398705094e600c72d4">init</a> (hexStamp: ?String)</td></tr>
<tr class="memdesc:ae948f4d32dd3b8398705094e600c72d4"><td class="mdescLeft">&#160;</td><td class="mdescRight">创建一个 TimeStamp 对象，从给定的十六进制形式的字符串（例如 "c1a089bd.fc904f6d"）获取时间戳的值。  <br /></td></tr>
<tr class="separator:ae948f4d32dd3b8398705094e600c72d4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:acf63f517689a2493f77229efd13706a5"><td class="memItemLeft" align="right" valign="top">public static func&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcommonsNet_1_1ntp_1_1TimeStamp.html#acf63f517689a2493f77229efd13706a5">getCurrentTime</a> (): <a class="el" href="classcommonsNet_1_1ntp_1_1TimeStamp.html">TimeStamp</a></td></tr>
<tr class="memdesc:acf63f517689a2493f77229efd13706a5"><td class="mdescLeft">&#160;</td><td class="mdescRight">构造一个 NTP TimeStamp 对象，并初始化为分配时的本地时区时间，精确到最近的毫秒。  <br /></td></tr>
<tr class="separator:acf63f517689a2493f77229efd13706a5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5a6796e1a1c981212a678915b78eb93c"><td class="memItemLeft" align="right" valign="top">public static func&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcommonsNet_1_1ntp_1_1TimeStamp.html#a5a6796e1a1c981212a678915b78eb93c">getNtpTime</a> (dateMillis: Int64): <a class="el" href="classcommonsNet_1_1ntp_1_1TimeStamp.html">TimeStamp</a></td></tr>
<tr class="memdesc:a5a6796e1a1c981212a678915b78eb93c"><td class="mdescLeft">&#160;</td><td class="mdescRight">将给定时间转换为 NTP TimeStamp 对象。  <br /></td></tr>
<tr class="separator:a5a6796e1a1c981212a678915b78eb93c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2cb52f8fb2b27f23844b574cfa8edd1f"><td class="memItemLeft" align="right" valign="top">public func&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcommonsNet_1_1ntp_1_1TimeStamp.html#a2cb52f8fb2b27f23844b574cfa8edd1f">getTime</a> (ntpTimeValue: Int64): Int64</td></tr>
<tr class="memdesc:a2cb52f8fb2b27f23844b574cfa8edd1f"><td class="mdescLeft">&#160;</td><td class="mdescRight">将64位 NTP 时间戳转换为自 1970年1月1日00:00:00 GMT 以来的毫秒数。  <br /></td></tr>
<tr class="separator:a2cb52f8fb2b27f23844b574cfa8edd1f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8f85fa503665c8e15f371d877490df9c"><td class="memItemLeft" align="right" valign="top">public static func&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcommonsNet_1_1ntp_1_1TimeStamp.html#a8f85fa503665c8e15f371d877490df9c">parseNtpString</a> (s: ?String): <a class="el" href="classcommonsNet_1_1ntp_1_1TimeStamp.html">TimeStamp</a></td></tr>
<tr class="memdesc:a8f85fa503665c8e15f371d877490df9c"><td class="mdescLeft">&#160;</td><td class="mdescRight">将字符串参数解析为 NTP 十六进制时间戳表示形式（例如 "c1a089bd.fc904f6d"），并创建对应 TimeStamp 对象。  <br /></td></tr>
<tr class="separator:a8f85fa503665c8e15f371d877490df9c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7346115020aa50c56871775c27d99a1c"><td class="memItemLeft" align="right" valign="top">public func&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcommonsNet_1_1ntp_1_1TimeStamp.html#a7346115020aa50c56871775c27d99a1c">toString</a> (ntpTime: Int64): String</td></tr>
<tr class="memdesc:a7346115020aa50c56871775c27d99a1c"><td class="mdescLeft">&#160;</td><td class="mdescRight">将64位 NTP 时间戳值转换为字符串表示形式。  <br /></td></tr>
<tr class="separator:a7346115020aa50c56871775c27d99a1c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a92ca1a29472bfff22218268ebdedc109"><td class="memItemLeft" align="right" valign="top">public override func&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcommonsNet_1_1ntp_1_1TimeStamp.html#a92ca1a29472bfff22218268ebdedc109">compare</a> (anotherTimeStamp: <a class="el" href="classcommonsNet_1_1ntp_1_1TimeStamp.html">TimeStamp</a>): Ordering</td></tr>
<tr class="memdesc:a92ca1a29472bfff22218268ebdedc109"><td class="mdescLeft">&#160;</td><td class="mdescRight">比较两个时间戳的大小。  <br /></td></tr>
<tr class="separator:a92ca1a29472bfff22218268ebdedc109"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8d9282e7aa440469c09ac59541a2fba9"><td class="memItemLeft" align="right" valign="top">public func&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcommonsNet_1_1ntp_1_1TimeStamp.html#a8d9282e7aa440469c09ac59541a2fba9">equal</a> (t: Object): Bool</td></tr>
<tr class="memdesc:a8d9282e7aa440469c09ac59541a2fba9"><td class="mdescLeft">&#160;</td><td class="mdescRight">比较此对象与指定对象是否相等。  <br /></td></tr>
<tr class="separator:a8d9282e7aa440469c09ac59541a2fba9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:acd91102ab38e17a3785a376c6bda8d59"><td class="memItemLeft" align="right" valign="top">public func&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcommonsNet_1_1ntp_1_1TimeStamp.html#acd91102ab38e17a3785a376c6bda8d59">getFraction</a> (): Int64</td></tr>
<tr class="memdesc:acd91102ab38e17a3785a376c6bda8d59"><td class="mdescLeft">&#160;</td><td class="mdescRight">返回表示此 NTP 时间戳的低位 32 位，即表示小数秒部分。  <br /></td></tr>
<tr class="separator:acd91102ab38e17a3785a376c6bda8d59"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a103c06166c1a712bc0100994bf758b79"><td class="memItemLeft" align="right" valign="top">public func&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcommonsNet_1_1ntp_1_1TimeStamp.html#a103c06166c1a712bc0100994bf758b79">getSeconds</a> (): Int64</td></tr>
<tr class="memdesc:a103c06166c1a712bc0100994bf758b79"><td class="mdescLeft">&#160;</td><td class="mdescRight">返回表示此 NTP 时间戳的高位 32 位，即表示秒数部分。  <br /></td></tr>
<tr class="separator:a103c06166c1a712bc0100994bf758b79"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a614eee495f1a9b7171e807650bb66b67"><td class="memItemLeft" align="right" valign="top">public func&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcommonsNet_1_1ntp_1_1TimeStamp.html#a614eee495f1a9b7171e807650bb66b67">getTime</a> (): Int64</td></tr>
<tr class="memdesc:a614eee495f1a9b7171e807650bb66b67"><td class="mdescLeft">&#160;</td><td class="mdescRight">将 NTP 时间戳转换为自 1970年1月1日00:00:00 GMT 以来的毫秒数。  <br /></td></tr>
<tr class="separator:a614eee495f1a9b7171e807650bb66b67"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7a45cfea170064e38ec0b3b27b3d284e"><td class="memItemLeft" align="right" valign="top">public func&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcommonsNet_1_1ntp_1_1TimeStamp.html#a7a45cfea170064e38ec0b3b27b3d284e">hashCode</a> (): Int32</td></tr>
<tr class="memdesc:a7a45cfea170064e38ec0b3b27b3d284e"><td class="mdescLeft">&#160;</td><td class="mdescRight">计算此 Timestamp 的哈希码。  <br /></td></tr>
<tr class="separator:a7a45cfea170064e38ec0b3b27b3d284e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa59d4a554cb8e4f583eb37bf757e93c9"><td class="memItemLeft" align="right" valign="top">public func&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcommonsNet_1_1ntp_1_1TimeStamp.html#aa59d4a554cb8e4f583eb37bf757e93c9">ntpValue</a> (): Int64</td></tr>
<tr class="memdesc:aa59d4a554cb8e4f583eb37bf757e93c9"><td class="mdescLeft">&#160;</td><td class="mdescRight">将此 Timestamp 的值作为 Int64 类型的整数值返回。  <br /></td></tr>
<tr class="separator:aa59d4a554cb8e4f583eb37bf757e93c9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af4dd78f68f4a4b63ede639c34cffe69f"><td class="memItemLeft" align="right" valign="top">public func&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcommonsNet_1_1ntp_1_1TimeStamp.html#af4dd78f68f4a4b63ede639c34cffe69f">toDateString</a> (): String</td></tr>
<tr class="memdesc:af4dd78f68f4a4b63ede639c34cffe69f"><td class="mdescLeft">&#160;</td><td class="mdescRight">将此 TimeStamp 对象的值转换为格式化的字符串，格式为 NTP_DATE_FORMAT 的值"EEE, MMM dd yyyy HH:mm:ss.SSS"  <br /></td></tr>
<tr class="separator:af4dd78f68f4a4b63ede639c34cffe69f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2d00334573a881cd1b1123b7d9b6d9d3"><td class="memItemLeft" align="right" valign="top">public func&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcommonsNet_1_1ntp_1_1TimeStamp.html#a2d00334573a881cd1b1123b7d9b6d9d3">toString</a> (): String</td></tr>
<tr class="memdesc:a2d00334573a881cd1b1123b7d9b6d9d3"><td class="mdescLeft">&#160;</td><td class="mdescRight">将此 TimeStamp 对象的值转换为字符串表示形式。  <br /></td></tr>
<tr class="separator:a2d00334573a881cd1b1123b7d9b6d9d3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a989f4f8f644e9afe2987e4e465315c3c"><td class="memItemLeft" align="right" valign="top">public func&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcommonsNet_1_1ntp_1_1TimeStamp.html#a989f4f8f644e9afe2987e4e465315c3c">toUTCString</a> (): String</td></tr>
<tr class="memdesc:a989f4f8f644e9afe2987e4e465315c3c"><td class="mdescLeft">&#160;</td><td class="mdescRight">将此将此 TimeStamp 对象的值转换为格式化的字符串，格式为：<br  />
 EEE, MMM dd yyyy HH:mm:ss.SSS UTC  <br /></td></tr>
<tr class="separator:a989f4f8f644e9afe2987e4e465315c3c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a63dc7bbebceff72fcf8acfebc2ef70e1"><td class="memItemLeft" align="right" valign="top">public operator&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcommonsNet_1_1ntp_1_1TimeStamp.html#a63dc7bbebceff72fcf8acfebc2ef70e1">!=</a> (that: <a class="el" href="classcommonsNet_1_1ntp_1_1TimeStamp.html">TimeStamp</a>): Bool</td></tr>
<tr class="memdesc:a63dc7bbebceff72fcf8acfebc2ef70e1"><td class="mdescLeft">&#160;</td><td class="mdescRight">比较 TimeStamp 对象是否不相等。  <br /></td></tr>
<tr class="separator:a63dc7bbebceff72fcf8acfebc2ef70e1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a31ac0c9be83436620f156ad4670cb8ac"><td class="memItemLeft" align="right" valign="top">public operator&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcommonsNet_1_1ntp_1_1TimeStamp.html#a31ac0c9be83436620f156ad4670cb8ac">==</a> (that: <a class="el" href="classcommonsNet_1_1ntp_1_1TimeStamp.html">TimeStamp</a>): Bool</td></tr>
<tr class="memdesc:a31ac0c9be83436620f156ad4670cb8ac"><td class="mdescLeft">&#160;</td><td class="mdescRight">比较 TimeStamp 对象是否相等。  <br /></td></tr>
<tr class="separator:a31ac0c9be83436620f156ad4670cb8ac"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pub-attribs" name="pub-attribs"></a>
Public 属性</h2></td></tr>
<tr class="memitem:abe63fff09823b804bc50fd2f6f88028a"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcommonsNet_1_1ntp_1_1TimeStamp.html#abe63fff09823b804bc50fd2f6f88028a">static let NTP_DATE_FORMAT</a> : String = &quot;www, MMM dd YYYY HH:mm:ss.S&quot;</td></tr>
<tr class="memdesc:abe63fff09823b804bc50fd2f6f88028a"><td class="mdescLeft">&#160;</td><td class="mdescRight">默认的 NTP 日期字符串格式。例如：Fri, Sep 12 2003 21:06:23.860。  <br /></td></tr>
<tr class="separator:abe63fff09823b804bc50fd2f6f88028a"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pro-methods" name="pro-methods"></a>
Protected 成员函数</h2></td></tr>
<tr class="memitem:a9557df5f030d4f373004a1f6a2db2881"><td class="memItemLeft" align="right" valign="top">protected static func&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcommonsNet_1_1ntp_1_1TimeStamp.html#a9557df5f030d4f373004a1f6a2db2881">decodeNtpHexString</a> (hexString: ?String): Int64</td></tr>
<tr class="memdesc:a9557df5f030d4f373004a1f6a2db2881"><td class="mdescLeft">&#160;</td><td class="mdescRight">将 NTP 时间戳十六进制字符串（例如“c1a089bd.fc904f6d”）转换为 NTP 64 位无符号定点数。  <br /></td></tr>
<tr class="separator:a9557df5f030d4f373004a1f6a2db2881"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a40d0d9385d2351d29091a0bfb381f48d"><td class="memItemLeft" align="right" valign="top">protected static func&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcommonsNet_1_1ntp_1_1TimeStamp.html#a40d0d9385d2351d29091a0bfb381f48d">toNtpTime</a> (millis: Int64): Int64</td></tr>
<tr class="memdesc:a40d0d9385d2351d29091a0bfb381f48d"><td class="mdescLeft">&#160;</td><td class="mdescRight">将给定时间（毫秒数）转换为64位 NTP 时间表示形式。  <br /></td></tr>
<tr class="separator:a40d0d9385d2351d29091a0bfb381f48d"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pro-attribs" name="pro-attribs"></a>
Protected 属性</h2></td></tr>
<tr class="memitem:a8c4c9f7dbcf539360754144fc8e8be8b"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcommonsNet_1_1ntp_1_1TimeStamp.html#a8c4c9f7dbcf539360754144fc8e8be8b">static let msb0baseTime</a> : Int64 = 2085978496000</td></tr>
<tr class="memdesc:a8c4c9f7dbcf539360754144fc8e8be8b"><td class="mdescLeft">&#160;</td><td class="mdescRight">如果 bit-0 = 0，则基准NTP时间是2036年2月7日 @ 06:28:16 UTC。  <br /></td></tr>
<tr class="separator:a8c4c9f7dbcf539360754144fc8e8be8b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae40bdf13300b5cc8a36bab2b8ce22014"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcommonsNet_1_1ntp_1_1TimeStamp.html#ae40bdf13300b5cc8a36bab2b8ce22014">static let msb1baseTime</a> : Int64 = -2208988800000</td></tr>
<tr class="memdesc:ae40bdf13300b5cc8a36bab2b8ce22014"><td class="mdescLeft">&#160;</td><td class="mdescRight">如果 bit-0 = 1，则基准NTP时间是1900年1月1日 @ 01:00:00 UTC。  <br /></td></tr>
<tr class="separator:ae40bdf13300b5cc8a36bab2b8ce22014"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pri-methods" name="pri-methods"></a>
Private 成员函数</h2></td></tr>
<tr class="memitem:a06a749e56f106e4e5c5f785d97d71885"><td class="memItemLeft" align="right" valign="top">private static func&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcommonsNet_1_1ntp_1_1TimeStamp.html#a06a749e56f106e4e5c5f785d97d71885">appendHexString</a> (buf: StringBuilder, l: Int64): Unit</td></tr>
<tr class="memdesc:a06a749e56f106e4e5c5f785d97d71885"><td class="mdescLeft">&#160;</td><td class="mdescRight">将给定 Int64 类型的整数转换为8字符十六进制字符串，并用0填充高位。  <br /></td></tr>
<tr class="separator:a06a749e56f106e4e5c5f785d97d71885"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pri-attribs" name="pri-attribs"></a>
Private 属性</h2></td></tr>
<tr class="memitem:a206e4504593e6beefb178dae04ac0265"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcommonsNet_1_1ntp_1_1TimeStamp.html#a206e4504593e6beefb178dae04ac0265">let ntpTime</a> : Int64</td></tr>
<tr class="memdesc:a206e4504593e6beefb178dae04ac0265"><td class="mdescLeft">&#160;</td><td class="mdescRight">NTP 时间戳的值。  <br /></td></tr>
<tr class="separator:a206e4504593e6beefb178dae04ac0265"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3c91ad54351cfbaa0338216ee59b89e9"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcommonsNet_1_1ntp_1_1TimeStamp.html#a3c91ad54351cfbaa0338216ee59b89e9">var simpleFormatter</a> : ?DateTime = None</td></tr>
<tr class="memdesc:a3c91ad54351cfbaa0338216ee59b89e9"><td class="mdescLeft">&#160;</td><td class="mdescRight">用于处理时间戳到日期和时间字符串的格式化，针对本地时区。  <br /></td></tr>
<tr class="separator:a3c91ad54351cfbaa0338216ee59b89e9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a77acd0b278f0e1819d7f5b64e83d32a5"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcommonsNet_1_1ntp_1_1TimeStamp.html#a77acd0b278f0e1819d7f5b64e83d32a5">var utcFormatter</a> : ?DateTime = None</td></tr>
<tr class="memdesc:a77acd0b278f0e1819d7f5b64e83d32a5"><td class="mdescLeft">&#160;</td><td class="mdescRight">用于处理时间戳到日期和时间字符串的格式化，针对 UTC 时区。  <br /></td></tr>
<tr class="separator:a77acd0b278f0e1819d7f5b64e83d32a5"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">详细描述</h2>
<div class="textblock"><p>TimeStamp 类表示网络时间协议（NTP）时间戳，按照 RFC-1305 和简单网络时间协议（SNTP，RFC-2030）定义。 </p>
<p>它包含一个64位无符号定点数，表示相对于1900年1月1日0时0分0秒的时间，单位为秒。 高阶的32位用来表示整数秒部分，低阶的32位用来表示小数部分。小数部分中，精确度大约为200皮秒。 当日期超过 MAX_LONG 并且回归到0时，假定溢出日期为2036年而非1900年。 根据最高有效位（MSB）选定时间基准：如果 MSB=0，则使用2036年作为基准；如果 MSB=1，则使用1900年作为基准。 </p>
</div><h2 class="groupheader">构造及析构函数说明</h2>
<a id="accd3819963b2bba840856d37eaf4a5b5" name="accd3819963b2bba840856d37eaf4a5b5"></a>
<h2 class="memtitle"><span class="permalink"><a href="#accd3819963b2bba840856d37eaf4a5b5">&#9670;&#160;</a></span>init() <span class="overload">[1/2]</span></h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">public commonsNet.ntp.TimeStamp.init </td>
          <td>(</td>
          <td class="paramname"><em>ntpTime</em>:&#160;</td>
          <td class="paramtype">Int64</td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>创建一个 TimeStamp 对象，使用给定64位长整型参数对时间戳进行赋值。 </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">ntpTime</td><td>要用来初始化 NTP 时间戳对象的时间戳值 </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="ae948f4d32dd3b8398705094e600c72d4" name="ae948f4d32dd3b8398705094e600c72d4"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ae948f4d32dd3b8398705094e600c72d4">&#9670;&#160;</a></span>init() <span class="overload">[2/2]</span></h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">public commonsNet.ntp.TimeStamp.init </td>
          <td>(</td>
          <td class="paramname"><em>hexStamp</em>:&#160;</td>
          <td class="paramtype">?String</td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>创建一个 TimeStamp 对象，从给定的十六进制形式的字符串（例如 "c1a089bd.fc904f6d"）获取时间戳的值。 </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">hexStamp</td><td>十六进制字符串表示的NTP时间戳 </td></tr>
  </table>
  </dd>
</dl>
<dl class="exception"><dt>异常</dt><dd>
  <table class="exception">
    <tr><td class="paramname">NumberFormatException</td><td>给定的字符串为 None ，不包含可解析的时间戳 </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<h2 class="groupheader">成员函数说明</h2>
<a id="a63dc7bbebceff72fcf8acfebc2ef70e1" name="a63dc7bbebceff72fcf8acfebc2ef70e1"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a63dc7bbebceff72fcf8acfebc2ef70e1">&#9670;&#160;</a></span>!=()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">    public operator  commonsNet.ntp.TimeStamp.!= </td>
          <td>(</td>
          <td class="paramname"><em>that</em>:&#160;</td>
          <td class="paramtype">TimeStamp</td><td>)</td>
          <td>: Bool </td>
        </tr>
      </table>
</div><div class="memdoc">

<p>比较 TimeStamp 对象是否不相等。 </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">that</td><td>比较的另外一个 TimeStamp 对象 </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd>不相等返回 true，相等返回 false </dd></dl>

</div>
</div>
<a id="a31ac0c9be83436620f156ad4670cb8ac" name="a31ac0c9be83436620f156ad4670cb8ac"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a31ac0c9be83436620f156ad4670cb8ac">&#9670;&#160;</a></span>==()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">    public operator  commonsNet.ntp.TimeStamp.== </td>
          <td>(</td>
          <td class="paramname"><em>that</em>:&#160;</td>
          <td class="paramtype">TimeStamp</td><td>)</td>
          <td>: Bool </td>
        </tr>
      </table>
</div><div class="memdoc">

<p>比较 TimeStamp 对象是否相等。 </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">that</td><td>比较的另外一个 TimeStamp 对象 </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd>相等返回 true，不相等返回 false </dd></dl>

</div>
</div>
<a id="a06a749e56f106e4e5c5f785d97d71885" name="a06a749e56f106e4e5c5f785d97d71885"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a06a749e56f106e4e5c5f785d97d71885">&#9670;&#160;</a></span>appendHexString()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">private static func commonsNet.ntp.TimeStamp.appendHexString </td>
          <td>(</td>
          <td class="paramname"><em>buf</em>:&#160;</td>
          <td class="paramtype">StringBuilder, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramname"><em>l</em>:&#160;</td>
          <td class="paramtype">Int64&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td>: Unit </td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">private</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>将给定 Int64 类型的整数转换为8字符十六进制字符串，并用0填充高位。 </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">buf</td><td>附加前导0的 StringBuilder </td></tr>
    <tr><td class="paramname">l</td><td>给定 Int64 类型的整数 </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="a92ca1a29472bfff22218268ebdedc109" name="a92ca1a29472bfff22218268ebdedc109"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a92ca1a29472bfff22218268ebdedc109">&#9670;&#160;</a></span>compare()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">public override func commonsNet.ntp.TimeStamp.compare </td>
          <td>(</td>
          <td class="paramname"><em>anotherTimeStamp</em>:&#160;</td>
          <td class="paramtype">TimeStamp</td><td>)</td>
          <td>: Ordering </td>
        </tr>
      </table>
</div><div class="memdoc">

<p>比较两个时间戳的大小。 </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">anotherTimeStamp</td><td>用于比较的另一个时间戳 <code><a class="el" href="">TimeStamp</a></code> 对象。 </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd>如果参数 TimeStamp 等于此 TimeStamp，则返回值为 Ordering.GT;<br  />
 如果此 TimeStamp 在数值上小于 TimeStamp 参数，则返回值为 Ordering.LT;<br  />
 如果此 TimeStamp 在数值上大于 TimeStamp 参数，则返回值为 Ordering.GT 。 </dd></dl>

</div>
</div>
<a id="a9557df5f030d4f373004a1f6a2db2881" name="a9557df5f030d4f373004a1f6a2db2881"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a9557df5f030d4f373004a1f6a2db2881">&#9670;&#160;</a></span>decodeNtpHexString()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">protected static func commonsNet.ntp.TimeStamp.decodeNtpHexString </td>
          <td>(</td>
          <td class="paramname"><em>hexString</em>:&#160;</td>
          <td class="paramtype">?String</td><td>)</td>
          <td>: Int64 </td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">protected</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>将 NTP 时间戳十六进制字符串（例如“c1a089bd.fc904f6d”）转换为 NTP 64 位无符号定点数。 </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">hexString</td><td>要转换的字符串</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd>NTP 64位时间戳值。 </dd></dl>
<dl class="exception"><dt>异常</dt><dd>
  <table class="exception">
    <tr><td class="paramname">NumberFormatException</td><td>给定的字符串为 None ，不包含可解析的时间戳 </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="a8d9282e7aa440469c09ac59541a2fba9" name="a8d9282e7aa440469c09ac59541a2fba9"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a8d9282e7aa440469c09ac59541a2fba9">&#9670;&#160;</a></span>equal()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">public func commonsNet.ntp.TimeStamp.equal </td>
          <td>(</td>
          <td class="paramname"><em>t</em>:&#160;</td>
          <td class="paramtype">Object</td><td>)</td>
          <td>: Bool </td>
        </tr>
      </table>
</div><div class="memdoc">

<p>比较此对象与指定对象是否相等。 </p>
<p>如果参数为含有与此对象相同时间戳值的 TimeStamp 对象，则返回 true 。</p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">obj</td><td>要与之比较的对象。 </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd>如果对象相同，则返回 true ；否则返回 false 。 </dd></dl>

</div>
</div>
<a id="acf63f517689a2493f77229efd13706a5" name="acf63f517689a2493f77229efd13706a5"></a>
<h2 class="memtitle"><span class="permalink"><a href="#acf63f517689a2493f77229efd13706a5">&#9670;&#160;</a></span>getCurrentTime()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">public static func commonsNet.ntp.TimeStamp.getCurrentTime </td>
          <td>(</td>
          <td class="paramtype"></td><td>)</td>
          <td>: <a class="el" href="classcommonsNet_1_1ntp_1_1TimeStamp.html">TimeStamp</a> </td>
        </tr>
      </table>
</div><div class="memdoc">

<p>构造一个 NTP TimeStamp 对象，并初始化为分配时的本地时区时间，精确到最近的毫秒。 </p>
<dl class="section return"><dt>返回</dt><dd>使用当前时间设置的 NTP TimeStamp 对象 </dd></dl>

</div>
</div>
<a id="acd91102ab38e17a3785a376c6bda8d59" name="acd91102ab38e17a3785a376c6bda8d59"></a>
<h2 class="memtitle"><span class="permalink"><a href="#acd91102ab38e17a3785a376c6bda8d59">&#9670;&#160;</a></span>getFraction()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">public func commonsNet.ntp.TimeStamp.getFraction </td>
          <td>(</td>
          <td class="paramtype"></td><td>)</td>
          <td>: Int64 </td>
        </tr>
      </table>
</div><div class="memdoc">

<p>返回表示此 NTP 时间戳的低位 32 位，即表示小数秒部分。 </p>
<dl class="section return"><dt>返回</dt><dd>此 NTP 时间戳表示的小数秒部分 </dd></dl>

</div>
</div>
<a id="a5a6796e1a1c981212a678915b78eb93c" name="a5a6796e1a1c981212a678915b78eb93c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a5a6796e1a1c981212a678915b78eb93c">&#9670;&#160;</a></span>getNtpTime()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">public static func commonsNet.ntp.TimeStamp.getNtpTime </td>
          <td>(</td>
          <td class="paramname"><em>dateMillis</em>:&#160;</td>
          <td class="paramtype">Int64</td><td>)</td>
          <td>: <a class="el" href="classcommonsNet_1_1ntp_1_1TimeStamp.html">TimeStamp</a> </td>
        </tr>
      </table>
</div><div class="memdoc">

<p>将给定时间转换为 NTP TimeStamp 对象。 </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">dateMillis</td><td>自 1970年1月1日00:00:00 GMT 以来的毫秒数 </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd>指定日期的 NTP TimeStamp 对象 </dd></dl>

</div>
</div>
<a id="a103c06166c1a712bc0100994bf758b79" name="a103c06166c1a712bc0100994bf758b79"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a103c06166c1a712bc0100994bf758b79">&#9670;&#160;</a></span>getSeconds()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">public func commonsNet.ntp.TimeStamp.getSeconds </td>
          <td>(</td>
          <td class="paramtype"></td><td>)</td>
          <td>: Int64 </td>
        </tr>
      </table>
</div><div class="memdoc">

<p>返回表示此 NTP 时间戳的高位 32 位，即表示秒数部分。 </p>
<dl class="section return"><dt>返回</dt><dd>此 NTP 时间戳表示的秒数部分。 </dd></dl>

</div>
</div>
<a id="a614eee495f1a9b7171e807650bb66b67" name="a614eee495f1a9b7171e807650bb66b67"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a614eee495f1a9b7171e807650bb66b67">&#9670;&#160;</a></span>getTime() <span class="overload">[1/2]</span></h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">public func commonsNet.ntp.TimeStamp.getTime </td>
          <td>(</td>
          <td class="paramtype"></td><td>)</td>
          <td>: Int64 </td>
        </tr>
      </table>
</div><div class="memdoc">

<p>将 NTP 时间戳转换为自 1970年1月1日00:00:00 GMT 以来的毫秒数。 </p>
<dl class="section return"><dt>返回</dt><dd>此 NTP 时间戳值表示的自 1970年1月1日 00:00:00 GMT 以来的毫秒数 </dd></dl>

</div>
</div>
<a id="a2cb52f8fb2b27f23844b574cfa8edd1f" name="a2cb52f8fb2b27f23844b574cfa8edd1f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a2cb52f8fb2b27f23844b574cfa8edd1f">&#9670;&#160;</a></span>getTime() <span class="overload">[2/2]</span></h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">public func commonsNet.ntp.TimeStamp.getTime </td>
          <td>(</td>
          <td class="paramname"><em>ntpTimeValue</em>:&#160;</td>
          <td class="paramtype">Int64</td><td>)</td>
          <td>: Int64 </td>
        </tr>
      </table>
</div><div class="memdoc">

<p>将64位 NTP 时间戳转换为自 1970年1月1日00:00:00 GMT 以来的毫秒数。 </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">ntpTimeValue</td><td>输入的64位无符号定点数 </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd>此NTP时间戳值表示的自 1970年1月1日00:00:00 GMT 以来的毫秒数 </dd></dl>

</div>
</div>
<a id="a7a45cfea170064e38ec0b3b27b3d284e" name="a7a45cfea170064e38ec0b3b27b3d284e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a7a45cfea170064e38ec0b3b27b3d284e">&#9670;&#160;</a></span>hashCode()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">public func commonsNet.ntp.TimeStamp.hashCode </td>
          <td>(</td>
          <td class="paramtype"></td><td>)</td>
          <td>: Int32 </td>
        </tr>
      </table>
</div><div class="memdoc">

<p>计算此 Timestamp 的哈希码。 </p>
<p>结果是由此 TimeStamp 对象表示的64位无符号定点数值的前后两个部分的异或值。 </p><dl class="section return"><dt>返回</dt><dd>此对象的哈希码值 </dd></dl>

</div>
</div>
<a id="aa59d4a554cb8e4f583eb37bf757e93c9" name="aa59d4a554cb8e4f583eb37bf757e93c9"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aa59d4a554cb8e4f583eb37bf757e93c9">&#9670;&#160;</a></span>ntpValue()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">public func commonsNet.ntp.TimeStamp.ntpValue </td>
          <td>(</td>
          <td class="paramtype"></td><td>)</td>
          <td>: Int64 </td>
        </tr>
      </table>
</div><div class="memdoc">

<p>将此 Timestamp 的值作为 Int64 类型的整数值返回。 </p>
<dl class="section return"><dt>返回</dt><dd>此对象表示的 Int64 类型的整数值 </dd></dl>

</div>
</div>
<a id="a8f85fa503665c8e15f371d877490df9c" name="a8f85fa503665c8e15f371d877490df9c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a8f85fa503665c8e15f371d877490df9c">&#9670;&#160;</a></span>parseNtpString()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">public static func commonsNet.ntp.TimeStamp.parseNtpString </td>
          <td>(</td>
          <td class="paramname"><em>s</em>:&#160;</td>
          <td class="paramtype">?String</td><td>)</td>
          <td>: <a class="el" href="classcommonsNet_1_1ntp_1_1TimeStamp.html">TimeStamp</a> </td>
        </tr>
      </table>
</div><div class="memdoc">

<p>将字符串参数解析为 NTP 十六进制时间戳表示形式（例如 "c1a089bd.fc904f6d"），并创建对应 TimeStamp 对象。 </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">s</td><td>十六进制字符串 </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd>给定字符串对应的 TimeStamp 对象 </dd></dl>
<dl class="exception"><dt>异常</dt><dd>
  <table class="exception">
    <tr><td class="paramname">NumberFormatException</td><td>给定的字符串为 None ，不包含可解析的时间戳 </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="af4dd78f68f4a4b63ede639c34cffe69f" name="af4dd78f68f4a4b63ede639c34cffe69f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#af4dd78f68f4a4b63ede639c34cffe69f">&#9670;&#160;</a></span>toDateString()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">public func commonsNet.ntp.TimeStamp.toDateString </td>
          <td>(</td>
          <td class="paramtype"></td><td>)</td>
          <td>: String </td>
        </tr>
      </table>
</div><div class="memdoc">

<p>将此 TimeStamp 对象的值转换为格式化的字符串，格式为 NTP_DATE_FORMAT 的值"EEE, MMM dd yyyy HH:mm:ss.SSS" </p>
<dl class="section return"><dt>返回</dt><dd>此日期在本地时区的字符串表示形式 </dd></dl>

</div>
</div>
<a id="a40d0d9385d2351d29091a0bfb381f48d" name="a40d0d9385d2351d29091a0bfb381f48d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a40d0d9385d2351d29091a0bfb381f48d">&#9670;&#160;</a></span>toNtpTime()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">protected static func commonsNet.ntp.TimeStamp.toNtpTime </td>
          <td>(</td>
          <td class="paramname"><em>millis</em>:&#160;</td>
          <td class="paramtype">Int64</td><td>)</td>
          <td>: Int64 </td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">protected</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>将给定时间（毫秒数）转换为64位 NTP 时间表示形式。 </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">millis</td><td>自 1970年1月1日00:00:00 GMT 以来的毫秒数 </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd>对应的 NTP 时间戳表示的值 </dd></dl>

</div>
</div>
<a id="a2d00334573a881cd1b1123b7d9b6d9d3" name="a2d00334573a881cd1b1123b7d9b6d9d3"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a2d00334573a881cd1b1123b7d9b6d9d3">&#9670;&#160;</a></span>toString() <span class="overload">[1/2]</span></h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">public func commonsNet.ntp.TimeStamp.toString </td>
          <td>(</td>
          <td class="paramtype"></td><td>)</td>
          <td>: String </td>
        </tr>
      </table>
</div><div class="memdoc">

<p>将此 TimeStamp 对象的值转换为字符串表示形式。 </p>
<p>NTP时间戳值以十六进制字符串表示，其中秒和小数秒部分由小数点分隔；例如，c1a089bd.fc904f6d == Tue, Dec 10 2002 10:41:49.986</p>
<dl class="section return"><dt>返回</dt><dd>表示NTP时间戳64位无符号定点数的十六进制字符串，秒和小数秒部分由小数点分隔 </dd></dl>

</div>
</div>
<a id="a7346115020aa50c56871775c27d99a1c" name="a7346115020aa50c56871775c27d99a1c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a7346115020aa50c56871775c27d99a1c">&#9670;&#160;</a></span>toString() <span class="overload">[2/2]</span></h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">public func commonsNet.ntp.TimeStamp.toString </td>
          <td>(</td>
          <td class="paramname"><em>ntpTime</em>:&#160;</td>
          <td class="paramtype">Int64</td><td>)</td>
          <td>: String </td>
        </tr>
      </table>
</div><div class="memdoc">

<p>将64位 NTP 时间戳值转换为字符串表示形式。 </p>
<p>NTP时间戳值以十六进制字符串表示，其中秒和小数秒部分由小数点分隔；例如，c1a089bd.fc904f6d == Tue, Dec 10 2002 10:41:49.986</p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">ntpTime</td><td>64位时间戳 </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd>表示NTP时间戳64位无符号定点数的十六进制字符串，秒和小数秒部分由小数点分隔 </dd></dl>

</div>
</div>
<a id="a989f4f8f644e9afe2987e4e465315c3c" name="a989f4f8f644e9afe2987e4e465315c3c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a989f4f8f644e9afe2987e4e465315c3c">&#9670;&#160;</a></span>toUTCString()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">public func commonsNet.ntp.TimeStamp.toUTCString </td>
          <td>(</td>
          <td class="paramtype"></td><td>)</td>
          <td>: String </td>
        </tr>
      </table>
</div><div class="memdoc">

<p>将此将此 TimeStamp 对象的值转换为格式化的字符串，格式为：<br  />
 EEE, MMM dd yyyy HH:mm:ss.SSS UTC </p>
<dl class="section return"><dt>返回</dt><dd>此日期在 UTC 时区的字符串表示形式 </dd></dl>

</div>
</div>
<h2 class="groupheader">类成员变量说明</h2>
<a id="a206e4504593e6beefb178dae04ac0265" name="a206e4504593e6beefb178dae04ac0265"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a206e4504593e6beefb178dae04ac0265">&#9670;&#160;</a></span>let ntpTime</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">commonsNet.ntp.TimeStamp.let ntpTime : Int64</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">private</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>NTP 时间戳的值。 </p>

</div>
</div>
<a id="a8c4c9f7dbcf539360754144fc8e8be8b" name="a8c4c9f7dbcf539360754144fc8e8be8b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a8c4c9f7dbcf539360754144fc8e8be8b">&#9670;&#160;</a></span>static let msb0baseTime</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">commonsNet.ntp.TimeStamp.static let msb0baseTime : Int64 = 2085978496000</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">protected</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>如果 bit-0 = 0，则基准NTP时间是2036年2月7日 @ 06:28:16 UTC。 </p>

</div>
</div>
<a id="ae40bdf13300b5cc8a36bab2b8ce22014" name="ae40bdf13300b5cc8a36bab2b8ce22014"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ae40bdf13300b5cc8a36bab2b8ce22014">&#9670;&#160;</a></span>static let msb1baseTime</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">commonsNet.ntp.TimeStamp.static let msb1baseTime : Int64 = -2208988800000</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">protected</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>如果 bit-0 = 1，则基准NTP时间是1900年1月1日 @ 01:00:00 UTC。 </p>

</div>
</div>
<a id="abe63fff09823b804bc50fd2f6f88028a" name="abe63fff09823b804bc50fd2f6f88028a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#abe63fff09823b804bc50fd2f6f88028a">&#9670;&#160;</a></span>static let NTP_DATE_FORMAT</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">commonsNet.ntp.TimeStamp.static let NTP_DATE_FORMAT : String = &quot;www, MMM dd YYYY HH:mm:ss.S&quot;</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>默认的 NTP 日期字符串格式。例如：Fri, Sep 12 2003 21:06:23.860。 </p>

</div>
</div>
<a id="a3c91ad54351cfbaa0338216ee59b89e9" name="a3c91ad54351cfbaa0338216ee59b89e9"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a3c91ad54351cfbaa0338216ee59b89e9">&#9670;&#160;</a></span>var simpleFormatter</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">commonsNet.ntp.TimeStamp.var simpleFormatter : ?DateTime = None</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">private</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>用于处理时间戳到日期和时间字符串的格式化，针对本地时区。 </p>

</div>
</div>
<a id="a77acd0b278f0e1819d7f5b64e83d32a5" name="a77acd0b278f0e1819d7f5b64e83d32a5"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a77acd0b278f0e1819d7f5b64e83d32a5">&#9670;&#160;</a></span>var utcFormatter</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">commonsNet.ntp.TimeStamp.var utcFormatter : ?DateTime = None</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">private</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>用于处理时间戳到日期和时间字符串的格式化，针对 UTC 时区。 </p>

</div>
</div>
<hr/>该类的文档由以下文件生成:<ul>
<li>src/ntp/<a class="el" href="time__stamp_8cj.html">time_stamp.cj</a></li>
</ul>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- HTML footer for doxygen 1.9.6-->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="namespacecommonsNet.html">commonsNet</a></li><li class="navelem"><a class="el" href="namespacecommonsNet_1_1ntp.html">ntp</a></li><li class="navelem"><a class="el" href="classcommonsNet_1_1ntp_1_1TimeStamp.html">TimeStamp</a></li>
    <li class="footer">制作者 <img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.6 </li>
  </ul>
</div>
</body>
</html>
